const mongoose = require('mongoose');
const Schema = mongoose.Schema;

var date = new Date()
var mydate = date.toLocaleString("zh-CN")

// Create Schema
const ProfileSchema = new Schema({
  type: {
    type: String
  },
  describe: {
    type: String
  },
  income: {
    type: Number,
    required: true
  },
  expend: {
    type: Number,
    required: true
  },
  // cash: {
  //   type: String,
  //   required: true
  // },
  // remark: {
  //   type: String
  // },
  date: {
    type: String,
    default: mydate
  }
});

module.exports = Profile = mongoose.model('profile', ProfileSchema);